home *** CD-ROM | disk | FTP | other *** search
/ Hobby PC 28 / Hobby PC 28.iso / MicrografxMM / FlowCharter / Autosamp / T_ONLINE.FRM < prev    next >
Text File  |  1997-03-04  |  5KB  |  167 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    Caption         =   "Text on Lines DEMO"
  6.    ClientHeight    =   3195
  7.    ClientLeft      =   1095
  8.    ClientTop       =   1485
  9.    ClientWidth     =   4560
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   0
  13.       weight          =   700
  14.       size            =   8.25
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   3600
  21.    Icon            =   "T_ONLINE.frx":0000
  22.    Left            =   1035
  23.    LinkTopic       =   "Form1"
  24.    ScaleHeight     =   3195
  25.    ScaleWidth      =   4560
  26.    Top             =   1140
  27.    Width           =   4680
  28.    Begin VB.PictureBox Picture1 
  29.       Appearance      =   0  'Flat
  30.       BackColor       =   &H80000005&
  31.       BorderStyle     =   0  'None
  32.       ForeColor       =   &H80000008&
  33.       Height          =   495
  34.       Left            =   240
  35.       Picture         =   "T_ONLINE.frx":030A
  36.       ScaleHeight     =   495
  37.       ScaleWidth      =   495
  38.       TabIndex        =   3
  39.       Top             =   2505
  40.       Width           =   495
  41.    End
  42.    Begin VB.TextBox Text1 
  43.       Appearance      =   0  'Flat
  44.       Height          =   315
  45.       Left            =   2010
  46.       TabIndex        =   1
  47.       Text            =   "Text1"
  48.       Top             =   2025
  49.       Width           =   630
  50.    End
  51.    Begin VB.CommandButton Command1 
  52.       Appearance      =   0  'Flat
  53.       BackColor       =   &H80000005&
  54.       Caption         =   "Color it BLUE"
  55.       Height          =   405
  56.       Left            =   2790
  57.       TabIndex        =   0
  58.       Top             =   1980
  59.       Width           =   1515
  60.    End
  61.    Begin VB.Label Label4 
  62.       Appearance      =   0  'Flat
  63.       BackColor       =   &H80000005&
  64.       Caption         =   $"T_ONLINE.frx":0614
  65.       ForeColor       =   &H80000008&
  66.       Height          =   855
  67.       Left            =   240
  68.       TabIndex        =   6
  69.       Top             =   870
  70.       Width           =   4005
  71.    End
  72.    Begin VB.Label Label2 
  73.       Appearance      =   0  'Flat
  74.       BackColor       =   &H80000005&
  75.       Caption         =   "This sample first loads a file in ABC FlowCharter called ""T_ONLINE.AF3"" which contains a line with 3 attached text objects. "
  76.       ForeColor       =   &H80000008&
  77.       Height          =   675
  78.       Left            =   270
  79.       TabIndex        =   5
  80.       Top             =   150
  81.       Width           =   4005
  82.    End
  83.    Begin VB.Label Label3 
  84.       Appearance      =   0  'Flat
  85.       BackColor       =   &H80000005&
  86.       Caption         =   "(c) Micrografx Inc., 1996. All Rights Reserved."
  87.       ForeColor       =   &H80000008&
  88.       Height          =   375
  89.       Left            =   870
  90.       TabIndex        =   4
  91.       Top             =   2580
  92.       Width           =   3210
  93.    End
  94.    Begin VB.Label Label1 
  95.       Appearance      =   0  'Flat
  96.       BackColor       =   &H80000005&
  97.       Caption         =   "Which Text Object?"
  98.       ForeColor       =   &H80000008&
  99.       Height          =   255
  100.       Left            =   225
  101.       TabIndex        =   2
  102.       Top             =   2070
  103.       Width           =   1815
  104.    End
  105. End
  106. Attribute VB_Name = "Form1"
  107. Attribute VB_Creatable = False
  108. Attribute VB_Exposed = False
  109. Dim ABC As Object
  110. Dim Chart As Object
  111.  
  112. Private Sub Command1_Click()
  113.     Dim Objects As Object
  114.     Dim TheLine As Object
  115.     Dim TheTextObject As Object
  116.     Dim ChosenTextObject As Object
  117.  
  118.     ' Since there is only one line in the
  119.     ' test chart uses ItemFromLines
  120.     Set TheLine = Chart.Objects.ItemFromLines
  121.  
  122.     ' Get an Objects collection to work with
  123.     Set Objects = Chart.Objects
  124.  
  125.     Counter = 1
  126.     Found = False
  127.     Do
  128.         ' Look at all objects attached to the line
  129.         Set TheTextObject = Objects.ItemFromAttachments(TheLine)
  130.  
  131.         ' If the attached object is a TextBlock (Type = 2)
  132.         If TheTextObject.Type = 2 Then
  133.  
  134.             ' Reset all text objects on the line
  135.             ' to black
  136.             TheTextObject.Color = ABC.BLACK
  137.  
  138.             ' If this is the requested Object
  139.             ' from the Text1 EditControl, store
  140.             ' the object in a variable called
  141.             ' ChosenTextObject
  142.             If Counter = Val(Text1) Then
  143.                 Set ChosenTextObject = TheTextObject
  144.                 Found = True
  145.             End If
  146.         Counter = Counter + 1
  147.         End If
  148.     
  149.     Loop While TheTextObject.Valid
  150.  
  151.     ' Set ChosenTextObject to Blue
  152.     If Found Then
  153.         ChosenTextObject.Color = ABC.BLUE
  154.     Else
  155.         MsgBox "The line only has " + Str$(Counter - 1) + " attached text objects. Cannot color text object " + Text1 + " blue.", 48, Form1.Caption
  156.     End If
  157. End Sub
  158.  
  159. Private Sub Form_Load()
  160.     Text1 = 1
  161.  
  162.     Set ABC = CreateObject("ABCFlow.application")
  163.     ABC.Visible = True
  164.     Set Chart = ABC.Open(App.Path + "\T_ONLINE.ABC")
  165. End Sub
  166.  
  167.